package com.sunlong.jiangwei.web;

import com.sunlong.jiangwei.entity.AsideMenu;
import com.sunlong.jiangwei.entity.result.Result;
import com.sunlong.jiangwei.service.IAsideMenu;
import com.sunlong.jiangwei.util.ResultUtil;
import com.sunlong.jiangwei.vo.AsideMenuVo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/jiangwei/aside-menu")
@Slf4j
public class AsideMenuController {
    @Autowired
    private IAsideMenu asideMenu;
    @GetMapping("/findAll")
    public Result<List<AsideMenu>> findAll(){
        List<AsideMenu> asideMenus = asideMenu.selectMenuItemsAll();
        return ResultUtil.data(asideMenus);
    }

    @GetMapping("/list")
    public Result<List<AsideMenuVo>> list(){
        List<AsideMenuVo> asideMenuVos = asideMenu.list();
        return ResultUtil.data(asideMenuVos);
    }

}
